<?php require_once("../../../includes_view/configuracao.php"); ?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title>BVX</title>
<link rel="icon" type="image/ico" href="<?php echo $url; ?>/assets/img/ico/iconeAgence.ico" />
<link href="<?php echo $url; ?>/assets/css/style.css" rel="stylesheet">
<script type="text/javascript" src="<?php echo $url; ?>/assets/js/jquery-1.6.js"></script>
<script type="text/javascript" src="<?php echo $url; ?>/assets/js/jquery-ui-1.8.12.custom.min.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
        $("tr:nth-child(even)").addClass("even");
    });
</script> 
</head>
<body>
<div id="conteiner corpo sistema grid"> 
<?php
	
	require_once("../../../util/util.php");
	require_once("../regras/negocio/relatorioNegocio.php");
	
	$objNegocio = new RelatorioNegocio();
	
	$dadosVeiculo = array();
	$arrayDados   = array();
	
	if(!empty($_GET["txtplaca"])){
		$arrayDados["placa"] = $_GET["txtplaca"];
	}
	
	$dadosVeiculo = $objNegocio->diasEstoque($arrayDados);
	
?>
<table class='flexgrid' width="100%">
<thead>
    <tr style="background:#EAEAEA; height:30px">
        <td>Placa</td>
        <td>Modelo</td>
        <td>Marca</td>
        <td>Cor</td>
        <td>Valor Compra</td>
        <td>Data Compra</td>
        <td>Dias Compra</td>
    </tr>
</thead>
<tbody>
<?php foreach($dadosVeiculo as $dados){ list($data,$hora) = explode(" ",$dados["dataCadastro"]); ?>
    <tr style="height:25px">
        <td><?=$dados["placa"]?></td>
        <td><?=$dados["modelo"]?></td>
        <td><?=$dados["marca"]?></td>
        <td><?=$dados["cor"]?></td>
        <td><?=Util::dbMoeda($dados["valorCompra"])?></td>
        <td><?=Util::bdData($data)?></td>
        <td><?=Util::calcularDias($data)?></td>
    </tr>
<?php } ?>	        
</tbody>
<tfoot>
    <tr style="background:#EAEAEA; height:30px">
        <td>Placa</td>
        <td>Modelo</td>
        <td>Marca</td>
        <td>Cor</td>
        <td>Valor Compra</td>
        <td>Data Compra</td>
        <td>Dias Compra</td>
    </tr>
</tfoot>
</table>
</div>
<br>
</body>
</html>